#include "StdAfx.h"
#include "DocumentIndexData.h"

DocumentIndexData::DocumentIndexData(std::string& docNo)
:m_docNo(docNo), m_Length(0)
{
}

void DocumentIndexData::AddWord(unsigned int termIndex, int multiplier)
{
	FrequencyMap::iterator it = m_TermFrequency.find(termIndex);
	if(it == m_TermFrequency.end())
		m_TermFrequency.insert(FrequencyMap::value_type(termIndex, multiplier));
	else
		it->second += multiplier;
	
	m_Length += multiplier;
}